package MyOs;
import java.util.*;
import exception.*;
public class ClockInterrupt{
      private static long delay=5*1000;//设置延时时间为5秒;
      private Task ts=new Task();
      public ClockInterrupt(){
      Timer timer = new Timer(); //设置定时器
      timer.schedule(ts,delay,delay);//5秒进行一次循环，执行Task中的run函数
  }
}
class Task extends TimerTask{
    private Schedule sched=new Schedule();
    public void run(){
       if(!(ProcessManager.getOperationQueue()).isEmpty())
           sched.schedule();
       else{
         System.out.println("程序运行结束");
         System.exit(0);
       }  
    }
}
